<?php 
session_start();
if(! isset($_SESSION['mobile'])){
	echo "<script>window.location.href='../view/accountPassword_login.v.html';</script>";
	exit;
}
 ?>
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html xmlns="http://www.w3.org/1999/xhtml" xml:lang="en">
<head>
	<meta http-equiv="Content-Type" content="text/html;charset=UTF-8">
	<meta name="viewport" content="width=device-width, initial-scale=1.0, minimum-scale=1.0, maximum-scale=1.0, user-scalable=no">
	<title>天天果园翻版</title>
	<style>
		body{
			margin :0px;
			padding:0px; 
		}

		@media screen and (min-device-width:321px){
			header{
				background:red;
			}		

		}
		ul{
			margin: 0px;
			padding: 0px;
			list-style: none;
		}
	</style>
	<script src="./js/jquery-3.2.1.min.js"></script>
	<link rel="stylesheet" href="./css/shoppingCart.css" />
</head>

<body>
	<header id = "">

	</header>
	<section id = "header_search_box">
		<a href="./index.v.html" id = "header_search_index"></a>
		<span id ="span_myOrchard">订单详情</span>
		<a href="./myOrchard.v.html" id = "myOrchard"></a>
	</section>

<section class="m-component-order" id="m-order">
        <ul class="list-unstyled m-order-content m-orderdetail">
            <li id="order-status-li">
                <div class="m-order-item">
                    <span class="pull-right m-ordering">待付款</span>订单编号 170922096536
                </div>
                <div class="m-order-item">
                    下单时间 2017-09-22 20:09:29
                </div>
            </li>
            <li>   
                <div class="m-order-item">                  
                    <div class="m-order-address">
                        hxm 13631785319
                        <p>上海上海市徐汇区sssss</p>
                    </div>    
                </div>
                <div class="m-order-item">
                    <span class="pull-right">09-24 周日 09:00-18:00</span>配送时间
                </div>
                <div class="m-order-item">
                    <span class="pull-right">微信支付</span>支付方式
                </div>   
                <div class="m-order-item">
                    <span class="pull-right"></span>发票信息
                </div>
            </li>
            <li>
               <div class="m-order-item">
                    <div class="clearfix m-order-prolist-tips"><span class="glyphicon fdayicon fdayicon-unfold pull-right" id="m-order-prolist"></span>商品清单<i>（共 1 件商品）</i></div>
                    <div class="m-cartlist">
                        <ul class="list-unstyled">
                              
                            <li>
                                                                <a href="/detail/index/24146">
                                                                    <img class="lazy pull-left" data-original="https://imgjd2.fruitday.com/images/product_pic/103/1/1-180x180-103-8UAUAW81.jpg" src="https://imgjd2.fruitday.com/images/product_pic/103/1/1-180x180-103-8UAUAW81.jpg" alt="" style="display: block;">
                                    <div class="m-cartlist-info">
                                        <h3>沙地红蜜薯</h3>
                                        <h4>规格：2斤</h4>
                                        <h5>￥15.80</h5>                           
                                    </div>
                                </a>
                                <span class="m-cartlist-nums">x 4</span>
                            </li>   
                                                        
                        </ul>    
                    </div>
                </div>
            </li>
            <li>
                <div class="m-order-item">
                    <span class="pull-right orange">￥63.20</span>商品总价
                </div>
                <div class="m-order-item">
                    <span class="pull-right orange">￥10</span>运费
                </div>
                <div class="m-order-item">
                    <span class="pull-right">￥0.00</span>积分抵扣
                </div>
                <div class="m-order-item">
                    <span class="pull-right">￥0.00</span>优惠券抵扣
                </div>
                <div class="m-order-item">
                    <span class="pull-right">￥0.00</span>账户余额抵扣
                </div>
                <div class="m-order-item">
                    <span class="pull-right">￥0</span>其他抵扣
                </div>
            </li>
            <li>
                <div class="m-order-item">
                   <span class="pull-right orange">￥73.20</span>实际支付
                </div>
            </li>
        </ul>
    </section>
<nav class="navbar navbar-default navbar-fixed-bottom m-component-foot" role="navigation">
      <div class="container text-right">
                <button type="button" class="btn btn-default navbar-btn" id="order-cancal" data-order="170922096536">取消订单</button>
                        <button type="button" class="btn btn-warning navbar-btn" id="order-pay" data-order="170922096536">立即支付</button>
                      </div>
    </nav>
	<script>
		function total(){
			var money = 0 
			for(i = 0; i < $("h5").length; i++){
				money += parseFloat($("h5").eq(i).text().substr(1)) * parseInt($("input[name='qty']").eq(i).val())
			}
			for(j = 0; j < $("span[name='total']").length; j++){
				$("span[name='total']").eq(j).html(parseFloat(money).toFixed(2))
			}
		}	
		function delNum(ts){
			//可以写成jQuery事件
			var obj_delNumber = $(ts).parent().children().eq(1).val()
			if(obj_delNumber > 1){
				obj_delNumber = parseInt(obj_delNumber)-1
				$(ts).parent().children().eq(1).val(obj_delNumber)
				 $(total())
			}
		}
		function addNum(ts){
			var obj_addNumber = $(ts).parent().children().eq(1).val()
			obj_addNumber = parseInt(obj_addNumber)+1
			$(ts).parent().children().eq(1).val(obj_addNumber)
			$(total())
		}
	
		function hideStr(){
			var obj = document.getElementsByName("tips")
			for(i=0;i<obj.length;i++){
				if(obj[i].innerText.length > 20){
					obj[i].innerText = obj[i].innerText.substr(0,20)+"..."
				}
			}
		}
		$(document).ready(function(){
			$(hideStr())
		});
		
	</script>
</body>
</html>